import axios from '../http';

export function create(data) {
	return axios({
		url: 'journal-content/add',
		method: 'post',
		data: {
			'cn_enterprise_full': data.company_title,
			'cn_enterprise_short': data.company_sub_title,
			'en_enterprise_full': data.e_company_title,
			'en_enterprise_short': data.e_company_sub_title,
			'cn_address': data.address,
			'en_address': data.e_address,
			'post_code': data.postal_code,
			'telephone': data.phone,
			'wx': data.wx_code,
			'e_mail': data.email,
			'url': data.company_website,
			'other': data.other_detail,
			'files': data.avatar,
			'cn_company_introduction': data.company_detail,
			'en_company_introduction': data.e_company_detail,
			'main_business': data.new_main_business,
		},
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
		}
	})
}

export function update(data) {
	return axios({
		url: 'journal-content/update',
		method: 'post',
		data: {
			'cn_enterprise_full': data.company_title,
			'cn_enterprise_short': data.company_sub_title,
			'en_enterprise_full': data.e_company_title,
			'en_enterprise_short': data.e_company_sub_title,
			'cn_address': data.address,
			'en_address': data.e_address,
			'post_code': data.postal_code,
			'telephone': data.phone,
			'wx': data.wx_code,
			'e_mail': data.email,
			'url': data.company_website,
			'other': data.other_detail,
			'files': data.avatar,
			'cn_company_introduction': data.company_detail,
			'en_company_introduction': data.e_company_detail,
			'main_business': data.new_main_business,
		},
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
		}
	})
}

export function mainBusinessShow() {
	return axios({
		url: 'main-business/show',
		method: 'get',
		data: {},
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
		}
	})
}

export function show() {
	return axios({
		url: 'journal-content/show',
		method: 'get',
		data: {},
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
		}
	})
}